/*    */ package com.zimbra.cs.servlet;
/*    */ 
/*    */ import java.io.IOException;
/*    */ import javax.servlet.Filter;
/*    */ import javax.servlet.FilterChain;
/*    */ import javax.servlet.FilterConfig;
/*    */ import javax.servlet.ServletException;
/*    */ import javax.servlet.ServletRequest;
/*    */ import javax.servlet.ServletResponse;
/*    */ import javax.servlet.http.HttpServletResponse;
/*    */ import javax.servlet.http.HttpServletResponseWrapper;
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ public class ETagHeaderFilter
/*    */   implements Filter
/*    */ {
/* 33 */   public static String ZIMBRA_ETAG_HEADER = "X-Zimbra-ETag";
/*    */   
/*    */ 
/*    */   public void destroy() {}
/*    */   
/*    */ 
/*    */   public void init(FilterConfig config)
/*    */     throws ServletException
/*    */   {}
/*    */   
/*    */   public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain)
/*    */     throws IOException, ServletException
/*    */   {
/* 46 */     ETagResponseWrapper wrapper = new ETagResponseWrapper((HttpServletResponse)response);
/* 47 */     chain.doFilter(request, wrapper);
/*    */   }
/*    */   
/*    */   private class ETagResponseWrapper extends HttpServletResponseWrapper
/*    */   {
/*    */     public ETagResponseWrapper(HttpServletResponse response) {
/* 53 */       super();
/*    */     }
/*    */     
/*    */     public void addHeader(String name, String value)
/*    */     {
/* 58 */       if (ETagHeaderFilter.ZIMBRA_ETAG_HEADER.equalsIgnoreCase(name)) {
/* 59 */         super.addHeader("ETag", value);
/*    */       }
/* 61 */       super.addHeader(name, value);
/*    */     }
/*    */     
/*    */     public void setHeader(String name, String value)
/*    */     {
/* 66 */       if (ETagHeaderFilter.ZIMBRA_ETAG_HEADER.equalsIgnoreCase(name)) {
/* 67 */         super.setHeader("ETag", value);
/*    */       }
/* 69 */       super.setHeader(name, value);
/*    */     }
/*    */   }
/*    */ }


/* Location:              /home/mint/zimbrastore.jar!/com/zimbra/cs/servlet/ETagHeaderFilter.class
 * Java compiler version: 7 (51.0)
 * JD-Core Version:       0.7.1
 */